from typing import Optional, Union

from pydantic import BaseModel, Field


class GenerateTextRecordSchemaReq(BaseModel):
    problem: Union[str, list[str]] = Field(description='问题', default="")


class GenerateTextRecordSchemaRes(BaseModel):

    id: int = Field(description='ID')
    user_id: Optional[int] = Field(description='用户ID')
    problem: Optional[str] = Field(description="问题")
    state: Optional[int] = Field(description="状态", default=1)
    answer: Optional[str] = Field(description="答案")
    answer_time: Optional[str] = Field(description="答案时间")
    draw: Optional[int] = Field(description="是否画图")
    publish: Optional[str] = Field(description="是否发布")


class GenerateTextRecordSchemaCreate(BaseModel):

    user_id: int = Field(description='用户ID')
    problem: str = Field(description="问题")


class GenerateTextRecordSchemaIDList(BaseModel):
    id: list[int] = Field(description='ID列表')


